/*
 * This class shows how to implement a BlobListener
 * 
 * First your Listener must implement a BlobManagerListener interface
 * then you shall overwrite the blobLost, blobsUpdated and newBlobDetected methods 
 * inserting your own procedures.
 * 
 */

package br.unb.camerainterativa.test;

import java.util.List;

import br.unb.camerainterativa.jb.vision.blob.Blob;
import br.unb.camerainterativa.jb.vision.blob.BlobManager;
import br.unb.camerainterativa.jb.vision.blob.BlobManagerListener;

public class BlobListener implements BlobManagerListener {

	BlobManager bm;
	
	public BlobListener(BlobManager bm) {
		this.bm = bm;
	}
	
	@Override
	public void blobLost(Blob blob) {
		// TODO Auto-generated method stub

	}

	@Override
	public void blobsUpdated() {
		List<Blob> lista = bm.getBlobList();
		for (Blob b: lista){
			System.out.println(b.label+":("+b.bounds.getCenterX()+","+b.bounds.getCenterY()+")");
		}
		// TODO Auto-generated method stub

	}

	@Override
	public void newBlobDetected(Blob blob) {
		// TODO Auto-generated method stub
		//System.out.println(blob.bounds.x + "," + blob.bounds.y);
	}

}
